package com.hksj.common.core.common;

/**
 * 客户端类型
 */
public enum ClientType {

    /**
     * pc端
     */
    PC(1,"PC"),

    /**
     * 小程序端
     */
    MINI_PROGRAM(3,"MINI_PROGRAM");

    private final Integer value;
    private final String code;

    ClientType(Integer value, String code){
        this.value = value;
        this.code = code;
    }

    public Integer value(){
        return this.value;
    }

    public String code(){return this.code;}

    public static String getCodeByValue(Integer value){
        for (ClientType clientType : values()) {
            if (clientType.value().equals(value)) {
                return clientType.code();
            }
        }
        return null;
    }
}
